home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1996 #6 / Amiga Plus CD - 1996 - No. 06.iso / pd / netz / internet-set.v4.0 / amitcp-4.0 / bin / backup.rexx next >
OS/2 REXX Batch file  |  1996-07-22  |  892b  |  58 lines

  1. /* Backup and Restore Net-Set files */
  2.  
  3. Call AddLib("rexxsupport.library",0,-30,0)
  4.  
  5. Do While HelpMe ~= 'Z'
  6. Say''
  7. Say 'What do you want me to do  (B)ackup or (R)estore ?'
  8. Say ''
  9. pull DoThis
  10. Say ''
  11. Say 'You chose ('||DoThis||') are you sure ? (Y/N)'
  12. Say ''
  13. pull Reply
  14.         
  15. If Reply = 'N' Then HelpMe = 'A'
  16. Else HelpMe = 'Z'
  17. EndIF
  18. Say ''
  19.  
  20. If DoThis = 'B' Then Call BackIt
  21. Else Call RestoreIt
  22. EndIf
  23.  
  24. Say 'All Done'
  25. Exit
  26.  
  27. /* Back it up */
  28.  
  29. BackIt:
  30.  
  31. MakeDir("AmiTCP:bin/backups")
  32.  
  33.  
  34. address command
  35.  
  36. 'copy AmiTCP:bin/netdial.#? AmiTCP:bin/backups'
  37. 'copy AmiTCP:bin/hangup.rexx AmiTCP:bin/backups'
  38. 'copy AmiTCP:db/resolv.conf AmiTCP:bin/backups'
  39.  
  40. HelpMe = 'Z'
  41.  
  42. return
  43.  
  44. /* Restore it to original */
  45.  
  46. RestoreIt:
  47.  
  48. address command
  49.  
  50. 'copy AmiTCP:bin/backups/netdial.#? AmiTCP:bin'
  51. 'copy AmiTCP:bin/backups/hangup.rexx AmiTCP:bin'
  52. 'copy AmiTCP:bin/backups/resolv.conf AmiTCP:db'
  53.  
  54. HelpMe = 'Z'
  55.  
  56. return
  57.  
  58.